<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>wickr-crypto-c: wickr_stream_ctx Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">wickr-crypto-c
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-attribs">Data Fields</a>  </div>
  <div class="headertitle">
<div class="title">wickr_stream_ctx Struct Reference<div class="ingroups"><a class="el" href="group__wickr__stream.html">wickr_stream</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>A context that is used for encrypting or decrypting a sequenced stream of data packets The stream context manages the state of stream operations including key evolution management based on the sequence number of the being encrypted / decrypted. The stream context is assigned a direction, and can only be used for encoding OR decoding of packets, and not both.  
 <a href="structwickr__stream__ctx.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="stream__ctx_8h_source.html">stream_ctx.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:a14ef322bbeec579ded7f35c5aeb0d3fa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__stream__ctx.html#a14ef322bbeec579ded7f35c5aeb0d3fa">engine</a></td></tr>
<tr class="separator:a14ef322bbeec579ded7f35c5aeb0d3fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3598b3c0415d13fafab6633f8c00a3c8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__stream__key.html">wickr_stream_key_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__stream__ctx.html#a3598b3c0415d13fafab6633f8c00a3c8">key</a></td></tr>
<tr class="separator:a3598b3c0415d13fafab6633f8c00a3c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a67c5066e87dbdc026358563daa51f174"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__stream__iv.html">wickr_stream_iv_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__stream__ctx.html#a67c5066e87dbdc026358563daa51f174">iv_factory</a></td></tr>
<tr class="separator:a67c5066e87dbdc026358563daa51f174"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf2c6ab54e1663e6a47e310fd68b3b3f"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__stream__ctx.html#abf2c6ab54e1663e6a47e310fd68b3b3f">last_seq</a></td></tr>
<tr class="separator:abf2c6ab54e1663e6a47e310fd68b3b3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34c622c3ca61348321261ee7a9c3ff91"><td class="memItemLeft" align="right" valign="top">wickr_stream_direction&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__stream__ctx.html#a34c622c3ca61348321261ee7a9c3ff91">direction</a></td></tr>
<tr class="separator:a34c622c3ca61348321261ee7a9c3ff91"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0e74b2c117666501373a5947d92e8c4"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__stream__ctx.html#aa0e74b2c117666501373a5947d92e8c4">ref_count</a></td></tr>
<tr class="separator:aa0e74b2c117666501373a5947d92e8c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A context that is used for encrypting or decrypting a sequenced stream of data packets The stream context manages the state of stream operations including key evolution management based on the sequence number of the being encrypted / decrypted. The stream context is assigned a direction, and can only be used for encoding OR decoding of packets, and not both. </p>
<p>Key evolution happens based on sequence number. Keyn+1 is generated by HMAC(Keyn, evolution_key). Gaps in sequence numbers are allowed and if the key needs to evolove multiple times, it will do so in a loop until the key is current, and data ciphering is possible. Sequence numbers can NOT go backwards due to the evolution's use of HMAC. Once Keyn+1 is generated, it is not possible to go back and calculate Keyn. </p>
</div><h2 class="groupheader">Field Documentation</h2>
<a id="a34c622c3ca61348321261ee7a9c3ff91"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a34c622c3ca61348321261ee7a9c3ff91">&#9670;&nbsp;</a></span>direction</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wickr_stream_ctx::direction</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>the direction of this stream context. direction can either be encoding or decoding </p>

</div>
</div>
<a id="a14ef322bbeec579ded7f35c5aeb0d3fa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a14ef322bbeec579ded7f35c5aeb0d3fa">&#9670;&nbsp;</a></span>engine</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wickr_stream_ctx::engine</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>crypto engine to be used for cipher operations, as well as key evolution using HMAC </p>

</div>
</div>
<a id="a67c5066e87dbdc026358563daa51f174"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a67c5066e87dbdc026358563daa51f174">&#9670;&nbsp;</a></span>iv_factory</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wickr_stream_ctx::iv_factory</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>the iv generator that this stream is using to create IVs </p>

</div>
</div>
<a id="a3598b3c0415d13fafab6633f8c00a3c8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3598b3c0415d13fafab6633f8c00a3c8">&#9670;&nbsp;</a></span>key</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wickr_stream_ctx::key</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>the current stream key that the stream context is using for encryption or decryption depending on direction the stream key will change over the course of packet encoding due to it's evolutions </p>

</div>
</div>
<a id="abf2c6ab54e1663e6a47e310fd68b3b3f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf2c6ab54e1663e6a47e310fd68b3b3f">&#9670;&nbsp;</a></span>last_seq</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wickr_stream_ctx::last_seq</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>the most recent sequence number that successfully encrypted or decrypted a packet </p>

</div>
</div>
<a id="aa0e74b2c117666501373a5947d92e8c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa0e74b2c117666501373a5947d92e8c4">&#9670;&nbsp;</a></span>ref_count</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wickr_stream_ctx::ref_count</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>current reference count of the stream </p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>src/wickrcrypto/include/wickrcrypto/<a class="el" href="stream__ctx_8h_source.html">stream_ctx.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
